package cn.silver.framework.log.enums;

import cn.silver.framework.core.model.DictModel;
import cn.silver.framework.core.utils.StreamUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * 操作状态
 *
 * @author Silver Zhou
 */
@Getter
@AllArgsConstructor
public enum OperateTypeEnums {
    /**
     * 数据查询
     */
    OPER_SEARCH("search", "数据查询"),
    /**
     * 数据变更
     */
    OPER_ALTER("alter", "数据变更"),
    OPER_FILE("file", "文件操作"),
    OPER_OTHER("other", "其他");

    private final String code;
    private final String name;

    public static List<DictModel> getModels() {
        return StreamUtils.toList(Arrays.asList(values()), item -> new DictModel(item.name, item.code));
    }
}
